package practice;

/**
 * @Description: https://leetcode.cn/problems/move-zeroes/
 * @Author Ammar
 * @Create 2023/7/19 19:39
 */
public class _283_移动零 {
    public void moveZeroes(int[] nums) {
        int result = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0) continue;
            if (i == result) {
                result++;
                continue;
            }
            nums[result] = nums[i];
            nums[i] = 0;
            result++;
        }
    }
}
